<?
# first get a mysql connection as per the FAQ

include ("Connect.php");

$fcontents = file ('./filename.csv');
# expects the csv file to be in the same dir as this script

for($i=0; $i<sizeof($fcontents); $i++) {
$line = trim($fcontents[$i]);
$arr = explode("\t", $line);
#if your data is comma separated
# instead of tab separated,
# change the '\t' above to ','

$sql = "insert into trial values ('".
implode("','", $arr) ."')";
mysql_query($sql);
echo $sql ."<br>\n";

}
?>